<?php
/**
 * 	Bushido
 *
 * @category   Bushido
 * @package    Bushido_Page
 * @copyright  Copyright (c) 2008-2009 Nathan Keyes
 * @author Nathan Keyes
 * @version    $Id: Abstract.php 7 2009-11-14 22:42:08Z nkeyes $
 */

/**
 * 
 * @author Nathan Keyes
 *
 */
abstract class Bushido_Page_Abstract extends Bushido_Object implements Bushido_Configurable_Interface
{
	protected $pageName = NULL;
	protected $rawData = NULL;
	protected $config;
	protected $_allowedConfigOptions;
	protected $_view = null;
	
	
	/**
	 * 
	 * @param $configOptions
	 * @param $view
	 * @return void
	 */
	public function __construct($configOptions = array(), $view = null)
	{
		parent::__construct();
		$this->config = new Bushido_Configurable();
		$this->config->setConfigOptions($configOptions);
		
		$this->$_view = $view;
	}
	
	
	/**
	 * 
	 * @return void
	 */
	protected abstract function _setRawData();
	
	
	/**
	 * 
	 * @return array
	 */
	public function getRawData()
	{
		if(!isset($this->rawData))
		{
			$this->_setRawData();
		}
		return $this->rawData;
	}
	
	
	/**
	 * 
	 * @return string
	 */
	public function getPageName()
	{
		if($this->pageName === NULL)
		{
			$this->pageName = get_class($this);
		}
		return $this->pageName;
	}
	
	/**
	 * 
	 * @return string
	 */
	public abstract function getPageDisplayName();
	
	/**
	 * (non-PHPdoc)
	 * @see library/Bushido/Configurable/Bushido_Configurable_Interface#getConfig()
	 */
	public function getConfig()
	{
		return $this->config;
	}
	
}